<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"               
                xmlns:cs="http://myfaces.apress.com/custom"
				template="/WEB-INF/layouts/standard.xhtml"
				xmlns:a4j="http://richfaces.org/a4j"
				xmlns:rich="http://richfaces.org/rich"
				xmlns:bf="http://www.bssmanager.com/jsf"
				xmlns:c="http://java.sun.com/jstl/core"
				xmlns:fn="http://java.sun.com/jsp/jstl/functions">

	<ui:define name="headIncludes">
		<style>
			.class11 {
				border-top: 1px solid gray;
			}
			.rc {
				margin:0px;
				border:0px;
				
			}			
			.cc {				
				border:0px;	
				margin:0px;
				padding:0px;			
			}
			td {
				vertical-align: top;
				padding:0px;
				margin:0px;
			}
			
			.rich-page-header { display:none }
				.rich-page-sidebar { display:none }
				.rich-page-footer { display:none} 
				.rich-page-body { margin-left:0;}		
				.rich-page-content {border:0}
				.rich-page-main {border:0}	
				
				.headerSection {
					display:none;
				}
				
				.rptItem {
					font-size: 12pt;
				}
		</style>
	</ui:define>
	
	
	<ui:define name="content">
		<h:form>	
			<h:commandButton value="Print" styleClass="noprint" onclick="window.print();return false;"/>
			
			<div align="center">		
			<rich:panel id="ddrc" style="border:0px; width:100%">	
							
				<h2 align="center">Daily Deposit and Refund</h2>				
			
				<rich:spacer height="25"/>
				
				<div align="right">				
					<h:panelGrid columns="2">
						<h:outputLabel value="From: " styleClass="rptItem"/>
						<h:outputText styleClass="rptItem" value="#{dailyDepositAndRefundController.lastReport.fromDate == null ? 'N/A':dailyDepositAndRefundController.lastReport.fromDate}" >
							<f:convertDateTime pattern="dd MMM yy HH:mm" timeZone="#{preferences.timeZone.ID}" />
						</h:outputText>
						<h:outputLabel styleClass="rptItem" value="To: "/>
						<h:outputText value="#{dailyDepositAndRefundController.lastReport.toDate}" styleClass="rptItem">
							<f:convertDateTime pattern="dd MMM yy HH:mm" timeZone="#{preferences.timeZone.ID}" />
						</h:outputText>
					</h:panelGrid>
				</div>
				
				<h:panelGrid  columns="5" style="border: solid 1px" width="100%">
					
									
								<rich:dataTable width="100%" value="#{arrayCreator[dailyDepositAndRefundController.lastReport.rows]}" var="row" style="margin-left:0px;">
									<f:facet name="header">
										<h:outputLabel styleClass="rptItem" value="-"/>
									</f:facet>
									<rich:column>
										<f:facet name="header">
											<h:outputLabel styleClass="rptItem" value="S/N"/>
										</f:facet>
										<h:outputText styleClass="rptItem" value="#{row}"/>	
									</rich:column>								
									<f:facet name="footer">
										<h:outputText styleClass="rptItem" value="-" style="float:right;"/>
									</f:facet>					
								</rich:dataTable>	
								
								
									
									<rich:dataTable width="100%" value="#{dailyDepositAndRefundController.lastReport.roomDeposits}" var="rdr"  >
										<f:facet name="header">
											<h:outputLabel styleClass="rptItem" value="Room Deposit"/>
										</f:facet>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="ID"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.payable.id == 0 ? '-':rdr.payable.id}"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Amount"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.amount == null ? '-' : rdr.amount}" style="float:right"/>
										</rich:column>	
										<f:facet name="footer">
											<h:outputText styleClass="rptItem" value="#{dailyDepositAndRefundController.lastReport.roomDepositTotal}" style="float:right;"/>
										</f:facet>									
									</rich:dataTable>
									<rich:dataTable width="100%"  value="#{dailyDepositAndRefundController.lastReport.roomRefunds}" var="rdr"  >
										<f:facet name="header">
											<h:outputLabel  styleClass="rptItem" value="Room Refund"/>
										</f:facet>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="ID"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.payable.id == 0 ? '-' : rdr.payable.id}"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Amount"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.amount == null ? '-' : rdr.amount}" style="float:right"/>
										</rich:column>	
										<f:facet name="footer">
											<h:outputText styleClass="rptItem" value="#{dailyDepositAndRefundController.lastReport.roomRefundTotal}" style="float:right;"/>
										</f:facet>									
									</rich:dataTable>
									
									<rich:dataTable width="100%"  value="#{dailyDepositAndRefundController.lastReport.utensilDeposits}" var="rdr"  >
										<f:facet name="header">
											<h:outputLabel styleClass="rptItem" value="Utensil Deposits"/>
										</f:facet>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="ID"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.payable.id == 0 ? '-' : rdr.payable.id}"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Amount"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.amount == null ? '-' : rdr.amount}" style="float:right"/>
										</rich:column>	
										<f:facet name="footer">
											<h:outputText styleClass="rptItem" value="#{dailyDepositAndRefundController.lastReport.utensilDepositTotal}" style="float:right;"/>
										</f:facet>									
									</rich:dataTable>
									
									<rich:dataTable width="100%"  value="#{dailyDepositAndRefundController.lastReport.utensilRefunds}" var="rdr" >
										<f:facet name="header">
											<h:outputLabel styleClass="rptItem" value="Utensil Refunds"/>
										</f:facet>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="ID"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.payable.id == 0 ? '-' : rdr.payable.id}"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Amount"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.amount == null ? '-' : rdr.amount}" style="float:right"/>
										</rich:column>
										<f:facet name="footer">
											<h:outputText styleClass="rptItem" value="#{dailyDepositAndRefundController.lastReport.utensilRefundTotal}" style="float:right;"/>
										</f:facet>										
									</rich:dataTable>
									
									
									
					</h:panelGrid>
					<rich:spacer height="20px"/>
					<h:panelGrid  columns="1" style="border: solid 1px" width="100%">
								
				<rich:dataTable width="100%"  value="#{dailyDepositAndRefundController.lastReport.cashBalanceData}" var="rdr" >
										<f:facet name="header">
											<h:outputLabel styleClass="rptItem" value="Cash Balance"/>
										</f:facet>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="-"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.header}"/>
										</rich:column>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Deposit"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.deposit}" style="float:right;"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Refund"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.refund}" style="float:right;"/>
										</rich:column>
										<rich:column>
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Balance"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.balance}" style="float:right;"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Opening"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.opening}" style="float:right;"/>
										</rich:column>
										<rich:column >
											<f:facet name="header">
												<h:outputText styleClass="rptItem" value="Closing"/>
											</f:facet>
											<h:outputText styleClass="rptItem" value="#{rdr.closing}" style="float:right;"/>
										</rich:column>
										<f:facet name="footer">
											<h:outputText styleClass="rptItem" value="Final: #{dailyDepositAndRefundController.lastReport.roomDepositTotal - dailyDepositAndRefundController.lastReport.roomRefundTotal + dailyDepositAndRefundController.lastReport.utensilDepositTotal - dailyDepositAndRefundController.lastReport.utensilRefundTotal}" style="float:right;"/>
										</f:facet>
									</rich:dataTable>
									</h:panelGrid>
											
			</rich:panel>	
			</div>			
		</h:form>		
	</ui:define>
</ui:composition>